package com.jeethink.erp.pileDetail.service.impl;

import java.util.List;
import com.jeethink.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.jeethink.erp.pileDetail.mapper.TbStockPileDetailMapper;
import com.jeethink.erp.pileDetail.domain.TbStockPileDetail;
import com.jeethink.erp.pileDetail.service.ITbStockPileDetailService;

/**
 * 库存流水明细Service业务层处理
 * 
 * @author ypr
 * @date 2021-05-28
 */
@Service
public class TbStockPileDetailServiceImpl implements ITbStockPileDetailService 
{
    @Autowired
    private TbStockPileDetailMapper tbStockPileDetailMapper;

    /**
     * 查询库存流水明细
     * 
     * @param id 库存流水明细ID
     * @return 库存流水明细
     */
    @Override
    public TbStockPileDetail selectTbStockPileDetailById(Long id)
    {
        return tbStockPileDetailMapper.selectTbStockPileDetailById(id);
    }

    /**
     * 查询库存流水明细列表
     * 
     * @param tbStockPileDetail 库存流水明细
     * @return 库存流水明细
     */
    @Override
    public List<TbStockPileDetail> selectTbStockPileDetailList(TbStockPileDetail tbStockPileDetail)
    {
        return tbStockPileDetailMapper.selectTbStockPileDetailList(tbStockPileDetail);
    }

    /**
     * 新增库存流水明细
     * 
     * @param tbStockPileDetail 库存流水明细
     * @return 结果
     */
    @Override
    public int insertTbStockPileDetail(TbStockPileDetail tbStockPileDetail)
    {
        tbStockPileDetail.setCreateTime(DateUtils.getNowDate());
        return tbStockPileDetailMapper.insertTbStockPileDetail(tbStockPileDetail);
    }

    /**
     * 修改库存流水明细
     * 
     * @param tbStockPileDetail 库存流水明细
     * @return 结果
     */
    @Override
    public int updateTbStockPileDetail(TbStockPileDetail tbStockPileDetail)
    {
        tbStockPileDetail.setUpdateTime(DateUtils.getNowDate());
        return tbStockPileDetailMapper.updateTbStockPileDetail(tbStockPileDetail);
    }

    /**
     * 批量删除库存流水明细
     * 
     * @param ids 需要删除的库存流水明细ID
     * @return 结果
     */
    @Override
    public int deleteTbStockPileDetailByIds(Long[] ids)
    {
        return tbStockPileDetailMapper.deleteTbStockPileDetailByIds(ids);
    }

    /**
     * 删除库存流水明细信息
     * 
     * @param id 库存流水明细ID
     * @return 结果
     */
    @Override
    public int deleteTbStockPileDetailById(Long id)
    {
        return tbStockPileDetailMapper.deleteTbStockPileDetailById(id);
    }
}
